<template>
  <div class="card-item">
    <slot name="icon-wrap">
      <div
        class="icon-wrap"
        :style="{
          background: iconBg,
          color: iconColor,
        }"
      >
        <slot name="icon">
          <a-icon :type="icon" v-if="icon" />
        </slot>
      </div>
    </slot>
    <div>
      <slot class="title">
        {{ title }}
      </slot>
      <div class="content">{{ content }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    icon: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
    content: {
      type: String,
      default: "",
    },
    iconBg: {
      type: String,
      default: "#f0f0f0",
    },
    iconColor: {
      type: String,
      default: "#666",
    },
  },
};
</script>

<style lang="scss" scoped>
.card-item {
  display: flex;
  align-items: center;
  padding: 4px;
  .icon-wrap {
    margin-right: 10px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
  }
  .title {
    font-size: 16px;
    font-weight: 500;
  }
  .content {
    font-size: 12px;
    color: #666;
  }
}
</style>
